<template>
	<view class="u-page">
		<u-row customStyle="margin-bottom: 10px">
			<u-col span="6">
				<view style="display: flex; " v-if="!isall">
					<u--text suffixIcon="arrow-down" @click="show=true" iconStyle="font-size: 20px" :bold="true"
						align="center" mode="date" :text="currentdate"></u--text>
					<u-button custom-style="width: 55px;" @click="toall" :plain="true" type="primary">显示全部</u-button>
				</view>	
				<view v-if="isall">
					<u-button custom-style="width: 150px;" @click="todate" :plain="true" type="primary">按日期选择 </u-button>
				</view>
			</u-col>
			<u-col span="6">
				<u-line direction="col">
				</u-line>
				<u--text suffixIcon="arrow-down" iconStyle="font-size: 18px" :bold="true" align="center" text="工程筛选"
					@click='showBuildFilter=true'>
				</u--text>

			</u-col>
		</u-row>

		<view class="index-block">
			<view class="index-block-title">每日统计</view>
			<u-row gutter="16" >
				<u-col span="4">
					<view class="item-tj item-tj-frist">
						<view style="padding: 16rpx; height: 100%; position: relative;font-size: 16px;    ">
							<view style="display: flex; color: white;flex-direction: row;">
								<!-- <u-icon name="photo" color="#fff"></u-icon> -->
								<text>安全交底</text>

							</view>
							<text style="color: white; font-size: 9px;float:right;">已上报/应上报</text>
							<view style="position: absolute; bottom: 48rpx; right: 16rpx;">
								<u-count-to :startVal="1" :endVal="safecount" :duration="1500" fontSize="14" color="#fff">
								</u-count-to><text style="font-size: 20px;color:white">/</text>
								<u-count-to :startVal="0" :endVal="buildcount" :duration="1500"  fontSize="14" color="#fff">
								</u-count-to>
							</view>
						</view>
					</view>
				</u-col>
				<u-col span="4">
					<view class="item-tj item-tj-second">
						<view style="padding: 16rpx; height: 100%; position: relative;font-size: 16px; ">
							<view style="display: flex; color: white;   flex-direction: row;">
								<!-- <u-icon name="photo" color="#fff"></u-icon> -->
								<text>工程日志</text>
							</view>
							<text style="color: white; font-size: 9px;float:right;">已上报/应上报</text>
							<view style="position: absolute; bottom: 48rpx; right: 16rpx;">
								<u-count-to :startVal="1" :endVal="dailycount" :duration="1500"  fontSize="14" color="#fff"
								>
								</u-count-to><text style="font-size: 20px;color:white">/</text>
								<u-count-to :startVal="1" :endVal="buildcount" :duration="1500"  fontSize="14" color="#fff"
									>
								</u-count-to>
							</view>
						</view>
					</view>
				</u-col>
				<u-col span="4">
					<view class="item-tj item-tj-thrid">
						<view style="padding: 16rpx; height: 100%; position: relative;font-size: 16px;">
							<view style="display: flex; color: white;flex-direction: row;">
								<!-- <u-icon name="photo" color="#fff"></u-icon> -->
								<text>检查</text>
							</view>
							<text style="color: white; font-size: 9px;float:right;">已检查/应检查</text>
							<view style="position: absolute; bottom: 48rpx; right: 16rpx;">
								<u-count-to :startVal="1" :endVal="checkcount" :duration="1500"  fontSize="14" color="#fff"
									>
								</u-count-to><text style="font-size: 20px;color:white">/</text>
								<u-count-to :startVal="1" :endVal="buildcount" :duration="1500" fontSize="14" color="#fff"
									>
								</u-count-to>
							</view>
						</view>
					</view>
				</u-col>
			</u-row>
		</view>
		<!-- 		<u-picker ref="uPicker" :show="showBuildFilter" :columns="columns" @cancel="showBuildFilter=false"
			@confirm="changeHandler"></u-picker> -->
		<u-button @click="godailynoid" :plain="true" type="primary">添加临时工程的日志</u-button>
		<u-popup :show="showBuildFilter" mode="top" @close="showBuildFilter=false" @open="showBuildFilter=true">
			<u--form labelPosition="left" labelWidth="100">
				<u-form-item label="工程名称" prop="parameters[0].fieldValue" borderBottom ref="item1">
					<u--input v-model="parameters[0].FieldValue" border="none" placeholder="工程名称"></u--input>
				</u-form-item>
				<u-form-item label="工程编号" prop="parameters[1].fieldValue" borderBottom ref="item1">
					<u--input v-model="parameters[1].FieldValue" borderBottom placeholder="工程编号"
						border="none"></u--input>
					<!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
				</u-form-item>
				<u-form-item label="施工负责人" prop="parameters[2].fieldValue" borderBottom ref="item1">
					<u--input v-model="parameters[2].FieldValue" borderBottom placeholder="施工负责人"
						border="none"></u--input>
					<!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
				</u-form-item>				
				<u-form-item label="提交情况"  borderBottom ref="item1">
					  <u-radio-group   v-model="isSubmit"    placement="column">
					    <u-radio   label="今日已交底"   name="今日已交底" :customStyle="{marginBottom: '8px'}"></u-radio>
					    <u-radio   label="今日未交底"   name="今日未交底" :customStyle="{marginBottom: '8px'}"></u-radio>
						 <u-radio   label="曾经交底"   name="曾经交底" :customStyle="{marginBottom: '8px'}"></u-radio>
						 <u-radio   label="从未交底"   name="从未交底" :customStyle="{marginBottom: '8px'}"></u-radio>
						<u-radio   label="全部"   name="全部" :customStyle="{marginBottom: '8px'}"></u-radio>
					  </u-radio-group>
				</u-form-item>
				<u-form-item label="工程状态"   borderBottom ref="item1">
					  <u-radio-group   v-model="isFinish"    placement="column">
						  <u-radio   label="施工中"   name="施工中" checked :customStyle="{marginBottom: '8px'}"></u-radio>
					      <u-radio   label="已竣工"   name="已竣工" :customStyle="{marginBottom: '8px'}"></u-radio>
					    
					  </u-radio-group>
				</u-form-item>
			</u--form>
			<u-button type="primary" text="查找"
				@click="currentpage=1; buildlistshow=[];init();showBuildFilter=false"></u-button>
		</u-popup>
		<u-calendar :show="show" minDate='2022-10-1' maxDate="2024-12-1" monthNum='48' :mode="'single'"
			@close="show=false" @confirm="confirm" :closeOnClickOverlay="true">
		</u-calendar>

		<u-list   height="70vh ！ important">
			<u-list-item class="u-demo-block" v-for="(build,index) in buildlistshow" :key="index">
				<!-- <text class="u-demo-block__title">多图模式</text> -->

				<u-line color="#2979ff"></u-line>
				<u-gap height="20"></u-gap>
				<view class="u-demo-block__content">
					<view class="album">
						<view class="album__avatar">
							<image src="/static/uview/common/logo.png" mode="" style="width: 32px;height: 32px;">
							</image>
						</view>
						<view class="album__content">
							<u--text :text="(index+1)+'.'+ build.Name" @click="golist(build.Id)" type="primary" bold size="17"></u--text>
							<u--text margin="0 0 8px 0" type="info" size="13"
								:text="'工程编号:'+(build.No||'')"></u--text>
							<u--text margin="0 0 8px 0" type="info" size="13"
								:text="'施工负责人:'+(build.ProjManager||'')+' '+(build.ProjManager2||'')"></u--text>
							<u-gap height="20"></u-gap>
						<!-- 	<u--text margin="0 0 8px 0" type="warning" v-if="build.NotWorkDay"
								text="该工程今日不开工"></u--text> -->
							<view >
								<u--text margin="0 0 8px 0" type="warning" text="安全交底"></u--text>
								<view  v-for="(safe,index1) in build.BuildSafeList"
									:key="index1">
									<u-button type="primary" customStyle="width:100px" size="mini" shape="circle"
										@click="gosafeview(safe.Id)" text="查看详情"></u-button>
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'提交时间：'+safe.CreateTime">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" size="13" prefixIcon="map" :text="safe.Addr"
										@click="gomap(safe.Latlng)">
									</u--text>
									<!-- 			<u--text margin="0 0 8px 0" type="info" text="安全交底文件照:">
								</u--text>
								<u-album :urls="safe.urls1"></u-album> -->
									<u--text margin="0 0 8px 0" type="info" text="人员照:">
									</u--text>
									<u-album :urls="geturls(safe.FileList, '人员照片')"></u-album>
									<u--text margin="0 0 8px 0" type="info" text="现场照:">
									</u--text>
									<u-album :urls="geturls(safe.FileList, '现场照片')"></u-album>
								</view>

								<u-gap height="20"></u-gap>
								<u-line color="#2979ff"></u-line>
								<u-gap height="20"></u-gap>
								<u--text margin="0 0 8px 0" type="warning" text="施工日志"></u--text>
								<view v-for="(daily,index2) in build.BuildDailyList">
									<u-button type="primary" size="mini" customStyle="width:100px" shape="circle"
										@click="godailyview(daily.Id)" text="查看详情"></u-button>
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'提交时间：'+daily.CreateTime">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" prefixIcon="map" size="13"
										:text="daily.Addr" @click="gomap(daily.Latlng)">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" text="工程施工日志照片:">
									</u--text>
									<u-album :urls="geturls(daily.FileList, '工程施工日志照片')"></u-album>
									<u--text margin="0 0 8px 0" type="info" text="主要施工环节与隐蔽工程照片:">
									</u--text>
									<u-album :urls="geturls(daily.FileList, '主要施工环节与隐蔽工程照片')"></u-album>
								</view>

								<u-gap height="20"></u-gap>
								<u-line color="#2979ff"></u-line>
								<u-gap height="20"></u-gap>
								<u--text margin="0 0 8px 0" type="warning" text="交底检查"></u--text>
								<view v-for="(check,index3) in build.BuildSafeCheckList">
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'检查时间：'+check.CreateTime">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'检查人：'+check.Creator">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'检查结果：'+check.Result">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'存在问题：'+check.Tag">
									</u--text>
									<u--text margin="0 0 8px 0" type="info" size="13" :text="'备注：'+check.Remark">
									</u--text>
									<u-gap height="20"></u-gap>
								</view>
								<u-gap height="20"></u-gap>
								<u-line color="#2979ff"></u-line>
								<u-gap height="20"></u-gap>

								<u--text margin="0 0 8px 0" type="primary" prefixIcon="plus-circle" text="添加安全交底"
									v-if="cansafe(build)" @click="gosafe(build.Id)">
								</u--text>
								<u--text margin="0 0 8px 0" type="primary" prefixIcon="edit-pen" text="添加工程日志"
									v-if="cansafe(build)" @click="godaily(build.Id)">
								</u--text>
								<u--text margin="0 0 8px 0" type="primary" prefixIcon="share-square" text="分派"
									 @click="changesend(build)" >
								</u--text>
							</view>
							<u--text margin="0 0 8px 0" type="primary" prefixIcon="chat" text="添加工程检查"
								v-if="!user.Roles || user.Roles.indexOf('管理员角色')>-1 || user.Roles.indexOf('项目经理')>-1 "
								@click="gocheck(build.Id)">
							</u--text>


						</view>
					</view>
				</view>
			</u-list-item>
			<u-loadmore :status="status" />
		</u-list>
		<!-- #ifdef MP-WEIXIN -->
		<u-back-top :scroll-top="scrollTop"></u-back-top>
		<!-- #endif -->
		<u-popup :show="showchange" @close="showchange=false" customStyle="height: 50vh; flex-basis: 50vh;" :closeable="true" round="10" >

			<view style="height: 30px;">
				<u-button type="primary" text="派工" @click="setChange(changeBulidId)" customStyle="width: 100px; height:30px; margin-top: 5px;"></u-button>
			</view>	
			<view class="checkboxList">
				<u-checkbox-group  placement="column" :borderBottom="true" v-model="changeBulidId">
		    	<u-checkbox v-for="(user,index) in changelist" customStyle="padding-bottom: 8px; margin-bottom: 16px; justify-content: center;"
				 :label="user.Name" :name="user.Id"  :key="index" shape="circle" @click="getLabel(user.Name)"></u-checkbox>
		    </u-checkbox-group>
			</view>			
		</u-popup>
		<!-- <u-loading-page :loading="loading" bg-color='rgba(0, 0, 0, 0.3)'></u-loading-page> -->
	<!-- 	<u-picker :loading="changeloading" @confirm="setChange" @cancel="showchange=false" :show="showchange"
			:columns="changelist" keyName="Name"></u-picker> -->

		<!-- <image src="https://project.gxrunxiang.com/cdn/gotop.png" style="width: 25px; height: 25px; position:fixed ;right: 3vh;top: 85vh;" @click="goTop" v-if="this.scrollllenght > 1200"></image> -->
		<!-- #ifdef MP-WEIXIN -->
			<!-- <privacyPopup ></privacyPopup> -->
		<!-- #endif -->
	</view>	
</template>

<script>
	const delay = (function () {
	 let timer = 0
	 return function (callback, ms) {
	  clearTimeout(timer)
	  timer = setTimeout(callback, ms)
	 }
	})()
	import {
		baseUrl
	} from '@/common/config.js'
	import coordtransform from 'coordtransform'
	// import privacyPopup from '@/components/easy-components.vue'
	import {
		CountByDay,
		ListByDay,
		getbuildlist,
		getbuildsafebyid,
		getfilebyoutid,
		GetChangeSendList,
		updatebuild,
		ChangeSend,
	} from '@/common/api.js'
	export default {
		data() {
			return {
				isFinish:"施工中",
				isSubmit:"全部",
				pageSize:10,
				status:'loadmore',
				changeloading: false,
				showchange: false,
				changelist: [],
				// scrolllength:0,
				scrollTop: 0,
				currentpage: 1,
				nomore: false,
				isloading: false,
				// user: {},
				loading: false,
				buildlistshow: [],
				showBuildFilter: false,
				ischange: false,
				parameters: [{
					FieldName: "Name",
					FieldValue: "",
					ConditionalType: "Like"
				}, {
					FieldName: "No",
					FieldValue: "",
					ConditionalType: "Like"
				}, {
					FieldName: "ProjManager",
					FieldValue: "",
					ConditionalType: "Like"
				}, ],
				currentdate: "",
				show: false,
				isall: true,
				buildcount: 0,
				safecount: 0,
				dailycount: 0,
				checkcount: 0,
				albumWidth: 10,
				buildlist: [],
				safelist: [],
				dailylist: [],
				checklist: [],
				imglist: [],
				changeBulidId:[],
				columns: [
					[]
				],
				currentbuild: {
					Name: ""
				},
				user: JSON.parse(uni.getStorageSync("$userinfo")),
			}
		},
		// components:{
		// 	privacyPopup
		// },
		onLoad() {
			// console.log("变了load")
			// this.user = JSON.parse(uni.getStorageSync("$userinfo"))
			// this.init()
			// this.getlist()
			// this.user = JSON.parse(uni.getStorageSync("$userinfo"))
			// this.user = JSON.parse(uni.getStorageSync("$userinfo"))
			// this.buildlistshow = []
			// this.init()
			uni.setStorageSync('changed', "0");
		},
		onReachBottom(){
			if(this.isloading === true ) return
			// delay(() => {
			    this.scrolltolower()
			   // }, 500)		
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		onShow() {
			
			// if (uni.getStorageSync('changed') == "1")
			// if(true)
			// {
			// this.getlist()
			// console.log("变了")
			// this.user = JSON.parse(uni.getStorageSync("$userinfo"))
			if(this.user != JSON.parse(uni.getStorageSync("$userinfo"))){ 
				this.user = JSON.parse(uni.getStorageSync("$userinfo"))
				this.parameters = [{
					FieldName: "Name",
					FieldValue: "",
					ConditionalType: "Like"
				}, {
					FieldName: "No",
					FieldValue: "",
					ConditionalType: "Like"
				}, {
					FieldName: "ProjManager",
					FieldValue: "",
					ConditionalType: "Like"
				}, ]
				this.init()
			}
			if (uni.getStorageSync("changed") == "1") {
				this.buildlistshow = []
				this.currentpage=1
				this.init()
			}
			uni.setStorageSync('changed', "0");
			// }
		},

		methods: {
			checkboxChange(n) {
				console.log('change', n);
			},
			geturls(flist, type) {
				return flist.filter(e => e.MyType == type).reduce((sum, cur) => {
					sum.push(`${baseUrl}/SysFile/download?id=${cur.Id}`)
					return sum
				}, [])

			},
			cansafe(build) {
				return true
				// if (this.user.Roles.indexOf('施工负责人角色') > -1)
				// 	return (this.user.Id == build.ProjManagerId || this.user.Id == build.ProjManagerId2) && this
				// 		.currentdate == this.getNowFormatDate()
				// if (this.user.Roles.indexOf('合作单位负责人') > -1)
				// 	return (this.user.Id == build.ProjManagerId || this.user.Id == build.ProjManagerId2 || this.user.Dept
				// 		.Name == build.SecondUnit) && this.currentdate == this.getNowFormatDate()
				// return false
			},
			setChange(e) {
				// console.log(this.changelist);
				// console.log(e);
				let arr = this.changelist.filter(re=>{
					return e.indexOf(re.Id)>-1
				})
				let arr2 = []
				let arr3 = []
				arr.forEach(re=>{
					arr2.push(re.Id)
					arr3.push(re.Name)
					
				})
				this.currentbuild.ProjManagerId2 = ','+arr2.join(',')+','
				this.currentbuild.ProjManager2 = arr3.join(' ')
				updatebuild(this.currentbuild).then(res => {
					this.init();
					this.showchange = false;
				})
			},
			changesend(build) {
				this.currentbuild = build
				this.changeloading = true
				this.showchange = true
				let unit = build.SecondUnit
				if (build.WorkCompany) //劳务的情况
				{
					unit = build.ProjManager
				}
				GetChangeSendList(unit).then(res => {
					this.changelist = res
					this.changeloading = false
				})

			},
			// getlist() {
			// 	// let querytype = this.$route.query.querytype
			// 	// let para = {
			// 	// 	Parameters: [],
			// 	// }

			// 	// para.Parameters.push({
			// 	// 	FieldName: "Status",
			// 	// 	ConditionalType: "Equal",
			// 	// 	FieldValue: "已派工"
			// 	// });

			// 	// para.OrderBys = ["CreateTime desc"]


			// 	// if (querytype == "日志") {


			// 	// }
			// 	getbuildlist(para).then(res => {
			// 		this.buildlist = res.data
			// 		this.columns = [
			// 			[]
			// 		]
			// 		for (var i = 0; i < this.buildlist.length; i++) {
			// 			this.columns[0].push(this.buildlist[i].Name)
			// 		}
			// 		if (this.buildlist.length > 0)
			// 			this.currentbuild = this.buildlist[0]
			// 	})
			// },
			gocheck(buildid) {
				uni.navigateTo({
					url: `/pages/index/buildsafecheck?buildid=${buildid}&targetdate=${this.currentdate}`
				})
			},
			golist(buildid) {
				uni.navigateTo({
					url: `/pages/index/buildimageslist?buildid=${buildid}`
				})
			},
			gocount() {
				uni.navigateTo({
					url: `/pages/index/buildcount?targetdate=${this.currentdate}`
				})
			},
			scrolltolower() {
				if (this.nomore == true)
					return
				this.currentpage++;
				this.loading = true
				this.init()
			},
			init() {
				this.loading = true
				this.isloading = true
				CountByDay(this.currentdate).then(res => {
					var counts = res.split(',')
					this.buildcount = counts[0]
					this.safecount = counts[1]
					this.dailycount = counts[2]
					this.checkcount = counts[3]
				})
				var userfilter = {
					FieldName: "ProjManager",
					FieldValue: "",
					ConditionalType: "Equal"
				}

				// if(!user.Roles || user.Roles.indexOf('管理员角色')>-1 )
				// {
				// 	userfilter
				// }
				
				if(this.user.UserRoleList[0].Role.Name=="项目经理角色" || this.user.UserRoleList[0].Role.Name=="区域经理") {
					userfilter.FieldName = "City"
					userfilter.FieldValue = this.user.Zone
				}
				if ( this.user.UserRoleList[0].Role.Name =="施工负责人角色" ) {
					// userfilter.fieldName = "ProjManager"
					// userfilter.fieldValue = this.user.Name
					userfilter = {
						"ConditionalList": [{
							"Key": 0,
							"Value": {
								"FieldName": "ProjManagerId",
								"FieldValue": this.user.Id,
								"ConditionalType": 0
							}
						}, {
							"Key": 1,
							"Value": {
								"FieldName": "ProjManagerId2",
								"FieldValue": ','+this.user.Id+',',
								"ConditionalType": 1
							}
						}]
					}
				}
				if (!this.user.Roles || this.user.Roles.indexOf('合作单位负责人') > -1) {
					// userfilter.fieldName = "ProjManager"
					// userfilter.fieldValue = this.user.Name
					userfilter = {
						"ConditionalList": [{
							"Key": 0,
							"Value": {
								"FieldName": "SecondUnit",
								"FieldValue": this.user.Dept.Name,
								"ConditionalType": 0
							}
						}, {
							"Key": 1,
							"Value": {
								"FieldName": "ProjManager2",
								"FieldValue": ','+this.user.Id+',',
								"ConditionalType": 1
							}
						}]
					}
				}

				// this.parameters = this.parameters.filter(e => e.fieldName != "ProjManager")
				this.parameters.push(userfilter)
				// console.log(this.parameters)
				//|| user.Roles.indexOf('项目经理')>-1 "
				let p = [...this.parameters]
				
				if(this.isFinish!="施工中")
				{
					p.push({
						FieldName: "Status",
						FieldValue: "已竣工",
						ConditionalType: 0
					})
				}
				else
				{
					p.push({
						FieldName: "Status",
						FieldValue: "已派工",
						ConditionalType: 0
					})
				}
		
				var para = {
					"jsonPara": JSON.stringify(p.filter(e => e.FieldValue != "")),
					"Parameters": p.filter(e => e.FieldValue != ""),
					"orderBys": [
						"CreateTime desc"
					],
					"pageSize": this.pageSize,
					"pageIndex": this.currentpage,
				}
				this.status="loading"
				if(this.isSubmit.indexOf('今日') !== -1 && this.currentdate == ''){
					this.currentdate = this.getNowFormatDate()
					this.ischange = true
				}
				ListByDay(para, this.currentdate,this.isSubmit).then(res => {
					console.log(this.user)
					if(this.currentpage*this.pageSize>=res.count)
					 this.status ="nomore"
					 else
					this.status ="loadmore"
					// if (res.data.length == 0) {
					// 	this.nomore = true
					// } else {
					// 	this.nomore = false
					// }
			
					this.buildlistshow = this.buildlistshow.concat(res.data)
					// this.loading = false
				})
				this.isloading = false
				if(this.ischange == true){
					this.currentdate = ''
					this.ischange = false
				}
			},
			getNowFormatDate() {
				var date = new Date();

				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var d = date.getDate();
				var hour = date.getHours();
				var minute = date.getMinutes();
				var second = date.getSeconds();

				if (month < 10) {
					month = "0" + month;
				}

				if (d < 10) {
					d = "0" + d;
				}

				if (hour < 10) {
					hour = "0" + hour;
				}

				if (minute < 10) {
					minute = "0" + hour;
				}

				if (second < 10) {
					second = "0" + second;
				}

				return year + "-" + month + "-" + d //+ " " +hour + ":" + minute + ":" + second;
			},
			confirm(e) {
				this.buildlistshow = []
				this.currentdate = e[0]
				this.show = false
				this.currentpage = 1
				this.init()
			},
			gomap(Latlon) {
				if (Latlon) {
					let latitude = parseFloat(Latlon.split(',')[0])
					let longitude = parseFloat(Latlon.split(',')[1])
					var lola = coordtransform.wgs84togcj02(longitude, latitude)
					uni.openLocation({
						latitude: lola[1],
						longitude: lola[0],
						success: function() {
							console.log('success');
						}
					});
				}
			},
			changeHandler(e) {
				const {
					columnIndex,
					value,
					values, // values为当前变化列的数组内容
					index,
					// 微信小程序无法将picker实例传出来，只能通过ref操作
					picker = this.$refs.uPicker
				} = e
				this.showBuildFilter = false
				// 当第一列值发生变化时，变化第二列(后一列)对应的选项
				// if (columnIndex === 0) {
				//     // picker为选择器this实例，变化第二列对应的选项
				//     picker.setColumnValues(1, this.columnData[index])
				// }
			},
			gosafe(id) {
				uni.navigateTo({
					url: "/pages/index/buildsafedetail?buildid=" + id
				})
			},
			godaily(id) {
				uni.navigateTo({
					url: "/pages/index/builddailydetail?buildid=" + id
				})
			},
			gosafeview(id) {
				uni.navigateTo({
					url: "/pages/index/buildsafeView?id=" + id
				})
			},
			godailyview(id) {
				uni.navigateTo({
					url: "/pages/index/builddailyView?id=" + id
				})
			},
			godailynoid(){
				uni.navigateTo({
					url: "/pages/index/builddailydetail"
				})
			},
			toall(){
				this.buildlistshow = []
				this.currentdate = ""
				this.currentpage = 1
				this.init()
				this.isall = !this.isall
			},
			todate(){
				this.currentdate = this.getNowFormatDate()
				this.show = true
				this.isall = !this.isall
			}
			// getscroll(lenth){
			// 	this.scrollTop = lenth
			// },
			// goTop(){
			// 	this.scrolllength = 0
			// }
		}
	}
</script>

<style lang="scss">
	.swiper {
		height: 220px;
	}

	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}

	.index-content {
		background-color: #f3f4f6;
		min-height: 100vh;
	}

	.index-block {
		padding: 40rpx;
		background-color: #fff;
	}

	.index-block-title {
		font-size: 40rpx;
		font-weight: bold;
		padding: 0 0 40rpx 0;
	}

	.item-tj {

		width: 103%;
		height: 160rpx;
		border-radius: 16rpx;

		&-frist {
			background-color: rgba($color: #2979ff, $alpha: 0.8);
			// background-image: url('/static/img/bg/qb.png');
		}

		&-second {
			background-color: rgba($color: #303133, $alpha: 0.8);
			// background-image: url('/static/img/bg/qb.png');
		}

		&-thrid {
			background-color: rgba($color: #19be6b, $alpha: 0.8);
			// background-image: url('/static/img/bg/qb.png');
		}
	}

	.detail_list {
		height: 700rpx;
		overflow: auto;
		color: #9E9E9E;

		.detail_item {
			display: flex;
			flex-direction: row;
			margin: 20rpx 0;
			align-items: center;

			.icon {
				width: 30%;
				text-align: center;

				li {
					font-size: 80rpx;
				}
			}

			.right_content {
				width: 50%;
				text-align: center;
			}

			.icon-income {
				color: #4AABF9;
			}

			.icon-expend {
				color: #E45521;
			}

			.money {
				color: #000;
			}
		}
	}

	.album {
		@include flex;
		align-items: flex-start;

		&__avatar {
			background-color: $u-bg-color;
			padding: 5px;
			border-radius: 3px;
		}

		&__content {
			margin-left: 10px;
			flex: 1;
		}
	}
	
	.checkboxList{
		 margin-top: 16px;
		 overflow-y: scroll; 
		 overscroll-behavior: none;
	}
	// .u-checkbox[data-v-c4a74aee]{
	// 	// border-bottom: 1px solid #94BCFF;
	// 	padding-bottom: 8px;
	// 	margin-bottom: 16px;
	// 	justify-content: center;
	// }
</style>